<!DOCTYPE html>
<head xmlns:v-bind="http://www.w3.org/1999/xhtml" >
    <meta charset="UTF-8">
    <title>demo14-vue自定义指令-钩子</title>
  <script src="./js/vue.min.js"></script>

</head>

<body>
   <div id="app" v-runoob:hello.a.b="message">

   </div>

</body>

<script type="application/javascript">
  //注册
  Vue.directive('runoob',{
    bind: function (el, binding, vnode) {
      var s = JSON.stringify;
      el.innerHTML =
        'name:' + s(binding.name) + "<br>"+
        'value:'+ s(binding.value) + "<br>"+
        'expression'+ s(binding.expression) + "<br>" +
        'argument' + s(binding.arg) + "<br>" +
        'modifiers' + s(binding.modifiers) + "<br>" +
        'vnode keys:' + Object.keys(vnode).join(',')
    }
  });
  new Vue({
    el: "#app",
    data: {
      message : '菜鸟教程！'
    }
  })


</script>
</html>
